package com.open.capacity.service.impl;

import com.open.capacity.dao.CollectionDao;
import com.open.capacity.model.CollectionStation;
import com.open.capacity.model.UserCollection;
import com.open.capacity.model.UserModel;
import com.open.capacity.service.CollectionService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: y_022
 * @date: 18:15-2021/6/24
 * @description:
 */
@Service
public class CollectionServiceImpl implements CollectionService {
    @Autowired
    private CollectionDao collectionDao;
    @Override
    public List<UserCollection> findUserCollectionListByUserId(UserModel userModel) {
        List<UserCollection> userCollectionList =  collectionDao.findUserCollectionListByUserId(userModel);
        return userCollectionList;
    }

    @Override
    public CollectionStation findUserCollectionStationsByStationId(UserCollection userCollection) {
        CollectionStation result =collectionDao.findUserCollectionStationsByStationId(userCollection);
        return  result;
    }

    @Override
    public void cancelCollection(UserCollection userCollection) {
        collectionDao.delCollection(userCollection);
    }
}
